package edu.towson.cosc.cosc455.biedermann.compiler;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.TreeMap;



public class LexicalTokens {
	
	//used to compare if a token is valid in MyLexicalAnalyzer 
	final static List<String>  lexicalTokenList = Arrays.asList("#HAI", "#KTHXBYE", "#MAEK HEAD", "#OIC", "#OBTW", 
		"#TLDR", "#GIMMEH TITLE", "#MKAY", "#MAEK PARAGRAF", "#GIMMEH BOLD", 
		"#GIMMEH ITALICS", "#MAEK LIST", "#GIMMEH ITEM", "#GIMMEH NEWLINE", 
		"#GIMMEH SOUNDZ", "#GIMMEH VIDZ", "#I HAS A", "#ITZ",  "#VISIBLE");
	
	//used to send start # tags to html format
	public static TreeMap<String,String> lolToHtml=new TreeMap<String, String>();
	
	//used to send end # tags to html format
	public static TreeMap<String,String> htmlBegintoEnd=new TreeMap<String, String>();
	
	//used to store all normal text from file to differentiate between tags
	public static ArrayList<String> textList = new ArrayList<String>();
	
	//contains fully translated file
	public static ArrayList<String> finalText = new ArrayList<String>();
	
	//used to maintain current variable in its proper scope
	public static ArrayList<String> variableList = new ArrayList<String>();
	
	//used to identify as start # tag to then translate it
	final static List<String> beginTags = Arrays.asList("#HAI", "#MAEK HEAD", "#GIMMEH TITLE","#OBTW","#MAEK PARAGRAF","#GIMMEH BOLD","#GIMMEH ITALICS","#MAEK LIST","#GIMMEH ITEM","#GIMMEH SOUNDZ","#GIMMEH VIDZ");
	
	//used to identify end # tag to then end scope block and translate it
	final static List<String> endTags = Arrays.asList("#KTHXBYE","#OIC","#TLDR","#MKAY");
	
	//used to find corresponding start tag to define end tag
	final static List<String> beginHtmlTags = Arrays.asList("<html>","<!--","<head>", " <html>","<title>","<p>","<b>","<i>","<ul>","<li>","<audio controls><source src=\"","<iframe src=\"");
 
	//dictionary of tags in lolspeak
	final static String DOC_BEGIN = "#HAI";
	final static String DOC_END = "#KTHXBYE";
	final static String COMMENT_BEGIN = "#OBTW";
	final static String COMMENT_END = "#TLDR";
	final static String HEAD_BEGIN = "#MAEK HEAD";
	final static String HEAD_END = "#OIC";
	final static String TITLE_BEGIN = "#GIMMEH TITLE";
	final static String TITLE_END = "#MKAY";
	final static String PARA_BEGIN = "#MAEK PARAGRAF";
	final static String PARA_END = "#OIC";
	final static String BOLD_BEGIN = "#GIMMEH BOLD";
	final static String BOLD_END = "#MKAY";
	final static String ITALICS_BEGIN = "#GIMMEH ITALICS";
	final static String ITALICS_END = "#MKAY";
	final static String LIST_BEGIN = "#MAEK LIST";
	final static String LIST_END = "#OIC";
	final static String ITEM_BEGIN = "#GIMMEH ITEM";
	final static String ITEM_END = "#MKAY";
	final static String NEWLINE = "#GIMMEH NEWLINE";
	final static String SOUNDS_BEGIN = "#GIMMEH SOUNDZ";
	final static String SOUNDS_END = "#MKAY";
	final static String VIDEO_BEGIN = "#GIMMEH VIDZ";
	final static String VIDEO_END = "#MKAY";
	final static String DEFINE_VAR_BEGIN = "#I HAS A";
	final static String DEFINE_VARI_MIDDLE = "#ITZ";
	final static String DEFINE_VAR_END = "#MKAY";
	final static String VARIABLE_BEGIN = "#VISIBLE";
	final static String VARIABLE_END = "#MKAY";
	
	//dictionary of tags in html
	final static String HTML_DOC_BEGIN = "<html>";
	final static String HTML_DOC_END = "</html>";
	final static String HTML_COMMENT_BEGIN = "<!--";
	final static String HTML_COMMENT_END = "-->";
	final static String HTML_HEAD_BEGIN = "<head>";
	final static String HTML_HEAD_END = "</head>";
	final static String HTML_TITLE_BEGIN = "<title>";
	final static String HTML_TITLE_END = "</title>";
	final static String HTML_PARA_BEGIN = "<p>";
	final static String HTML_PARA_END = "</p>";
	final static String HTML_BOLD_BEGIN = "<b>";
	final static String HTML_BOLD_END = "</b>";
	final static String HTML_ITALICS_BEGIN = "<i>";
	final static String HTML_ITALICS_END = "</i>";
	final static String HTML_LIST_BEGIN = "<ul>";
	final static String HTML_LIST_END = "</ul>";
	final static String HTML_ITEM_BEGIN = "<li>";
	final static String HTML_ITEM_END = "</li>";
	final static String HTML_NEWLINE = "<br>";
	final static String HTML_SOUNDS_BEGIN = "<audio controls><source src=\"";
	final static String HTML_SOUNDS_END = "\"></audio";
	final static String HTML_VIDEO_BEGIN = "<iframe src=\"";
	final static String HTML_VIDEO_END = "\"/>";
	
	//method to add the relationship between lolspeak and html meaning
	public void addToMap(){
		lolToHtml.put(DOC_BEGIN, HTML_DOC_BEGIN);
		lolToHtml.put(COMMENT_BEGIN, HTML_COMMENT_BEGIN);
		lolToHtml.put(HEAD_BEGIN, HTML_HEAD_BEGIN);
		lolToHtml.put(TITLE_BEGIN, HTML_TITLE_BEGIN);
		lolToHtml.put(PARA_BEGIN, HTML_PARA_BEGIN);
		lolToHtml.put(BOLD_BEGIN, HTML_BOLD_BEGIN);
		lolToHtml.put(ITALICS_BEGIN, HTML_ITALICS_BEGIN);
		lolToHtml.put(LIST_BEGIN, HTML_LIST_BEGIN);
		lolToHtml.put(ITEM_BEGIN, HTML_ITEM_BEGIN);
		lolToHtml.put(NEWLINE, HTML_NEWLINE);
		lolToHtml.put(SOUNDS_BEGIN, HTML_SOUNDS_BEGIN);
		lolToHtml.put(VIDEO_BEGIN, HTML_VIDEO_BEGIN);
		
		htmlBegintoEnd.put(HTML_DOC_BEGIN, HTML_DOC_END );
		htmlBegintoEnd.put(HTML_COMMENT_BEGIN, HTML_COMMENT_END );
		htmlBegintoEnd.put(HTML_HEAD_BEGIN, HTML_HEAD_END );
		htmlBegintoEnd.put(HTML_TITLE_BEGIN, HTML_TITLE_END );
		htmlBegintoEnd.put(HTML_PARA_BEGIN, HTML_PARA_END);
		htmlBegintoEnd.put(HTML_BOLD_BEGIN, HTML_BOLD_END );
		htmlBegintoEnd.put(HTML_ITALICS_BEGIN, HTML_ITALICS_END );
		htmlBegintoEnd.put(HTML_LIST_BEGIN, HTML_LIST_END );
		htmlBegintoEnd.put(HTML_ITEM_BEGIN, HTML_ITEM_END );
		htmlBegintoEnd.put(HTML_SOUNDS_BEGIN, HTML_SOUNDS_END );
		htmlBegintoEnd.put(HTML_VIDEO_BEGIN, HTML_VIDEO_END );
	}
	
}
